<!DOCTYPE html>
<html>

<head>
  <meta charset="utf-8">
  <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
  <title>德德后台管理系统</title>
  <link rel="stylesheet" href="/assets/layui/css/layui.css">
</head>

<body>
  <div class="layui-layout layui-layout-admin">
    <!-- 导入公共页面 -->
    {{ include "./common/header.html" }}

    <!-- 导入公共页面 -->
    {{ include "./common/side.html" }}

    <div class="layui-body">
      <!-- 内容主体区域 -->
      <div style="padding: 15px;">文章列表区域.</div>
    </div>

    <div class="layui-footer">
      <!-- 底部固定区域 -->
      底部固定区域
    </div>
  </div>
  <script src="/assets/layui/layui.js"></script>
  <script>
    //JS 
    layui.use(['element', 'layer', 'util'], function () {
      var element = layui.element
        , layer = layui.layer
        , util = layui.util
        , $ = layui.$;
      var table = layui.table;

      table.render({
        elem: '#test'
        , url: '/artData'/*tpa=https://www.layuiweb.com/test/table/demo1.json*/
        , cols: [[
          { type: 'checkbox', fixed: 'left' }
          , { field: 'id', title: 'ID', width: 80, fixed: 'left', unresize: true, sort: true }
          , { field: 'title', title: '文章标题' }
          , { field: 'pic', title: '封面图' }
          , { field: 'content', title: '内容' }
          , { field: 'username', title: '发布者', sort: true }
          , { field: 'statusText', title: '状态', }
          , { field: 'add_date', title: '添加时间' }
          , { field: 'cate_name', title: '所属分类', sort: true }
          , { fixed: 'right', title: '操作', toolbar: '#barDemo', }
        ]],
        page: {
          limit: 3,
          prev: '上一页',
          next: '下一页'
        }
      });

      //头部事件
      util.event('lay-header-event', {
        //左侧菜单事件
        menuLeft: function (othis) {
          layer.msg('展开左侧菜单的操作111', { icon: 0 });
        }
        , menuRight: function () {
          layer.open({
            type: 1
            , content: '<div style="padding: 15px;">处理右侧面板的操作234</div>'
            , area: ['260px', '100%']
            , offset: 'rt' //右上角
            , anim: 5
            , shadeClose: true
          });
        }
      });

    });
  </script>
</body>

</html>